using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for ChatServer
/// </summary>
public class ChatServer
{
    public static string GetChatButton(string chatserver, string nickname)
    {
        string cs = chatserver.ToLower();
        if (cs == "yahoo")
            return Yahoo(nickname);
        else if (cs == "skype")
            return Skype(nickname);
        else if (cs == "msn")
            return MSN(nickname);
        else if (cs == "icq")
            return ICQ(nickname);
        else
            return "";
    }
    public static string Yahoo(string nickname)
    {
        string rs = "";
        rs += "<a href='ymsgr:sendim?{0}&m=Hello'>";
        rs += "    <img border='0' src='http://opi.yahoo.com/online?u={0}&m=g&t=2&l=us' alt='Send me a message' />";
        rs += "</a>";

        if (nickname != "")
            rs = String.Format(rs, nickname);
        else
            rs = "";

        return rs;
    }

    public static string Skype(string nickname)
    {
        string rs = "";
        rs += "<a href='skype:{0}?chat'>";
        rs += "    <img src='http://mystatus.skype.com/smallclassic/{0}' style='border: none;' width='114' height='20' alt='Chat with me' />";
        rs += "</a>";

        if (nickname != "")
            rs = String.Format(rs, nickname);
        else
            rs = "";

        return rs;
    }

    public static string MSN(string nickname)
    {
        string rs = "";
        rs += "<a href='msnim:add?contact={0}'>";
        rs += "    <img src='http://microsoftwlmessengermkt.112.2o7.net/b/ss/mswlmmktbuttoncom/1/H.9--NS/1?ns=microsoftwlmessengermkt&pageName=Button&20Impression&c7=A&c8=White&c9=Click&c10=A:White:Click' width='1' height='1' border='0' />";
        rs += "    <img src='http://global.msads.net/ads/pronws/A_White_Click.png' style='Clear: Both; Padding-Bottom: 10px; Border: 0px' />";
        rs += "</a>";

        if (nickname != "")
            rs = String.Format(rs, nickname);
        else
            rs = "";

        return rs;
    }

    public static string ICQ(string nickname)
    {
        string rs = "<img src='http://status.icq.com/online.gif?icq={0}&img=2'>";

        if (nickname != "")
            rs = String.Format(rs, nickname);
        else
            rs = "";

        return rs;
    }
}
